import request from '@/utils/request'

export const addRoles = data => request.post('/sys/role', data)

export const getRoles = params => request.get('/sys/role', { params })

export const updateRoles = data => request.put('/sys/role/' + data.id, data)

export const delRoles = id => request.delete('/sys/role/' + id)

export const findRoles = id => request.get('/sys/role/' + id)

export const assignPremRoles = data => request.put('/sys/role/assignPrem', data)

export function assignPerm(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
